package com.sinosoft.weixin.utils;

import java.util.Calendar;
import java.util.Date;

/**
 * Created by huzhengying on 2017/11/20.
 */
public class MyDateUtils {
    public static Date getCurrentMinTime(){
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        Date currentMinTime = calendar.getTime();
        return currentMinTime;
    }

    public static Date getCurrentMaxTime(){
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.add(Calendar.DAY_OF_MONTH, 1);
        calendar.add(Calendar.SECOND, -1);
        Date currentMaxTime = calendar.getTime();
        return currentMaxTime;
    }
}
